//账号管理模块
import request from '@/utils/request.js'//引入增强过后的axios
export const checkLogin=(data)=>{
    return request({
        method:'post',
        url:'/users/checkLogin',
        data,
    })
}
// 账号列表
export const userList=(params)=>{
    return request({
        method:'get',
        url:'/users/list',
        params
    })
}
// 删除账号
export const userDel=(params)=>{
    return request({
        method:'get',
        url:'/users/del',
        params
    })
}
// 添加账号
export const userAdd=(data)=>{
    return request({
        method:'post',
        url:'/users/add',
        data
    })
}

//修改密码
export const changePad=(data)=>{
    return request({
        method:'post',
        url:'/users/editpwd',
        data
    })
}

// 检测旧密码
export const oldPad=(params)=>{
    return request({
        method:'GET',
        url:'/users/checkoldpwd',
        params
    })
}

//修改功能
export const edit=(data)=>{
    return request({
        method:'post',
        url:'/users/edit',
        data
    })
}
// 个人信息
export const userInfo=()=>{
    return request({
        method:'GET',
        url:'/users/info',
        // 不需要传参
    })
}

// 修改头像
export const avatarEdit = params =>{
    return request({
        method: 'get',
        url: '/users/avataredit',
        params: params,
    });
}
// 批量删除
export const batchdel=(data)=>{
    return request({
        method:'post',
        url:'/users/batchdel',
        data
    })
}
// 商品分类
export const categories = params =>{
    return request({
        method: 'get',
        url: '/goods/categories',
        params: params,
    });
}

// 添加商品
export const goodsAdd=(data)=>{
    return request({
        method:'post',
        url:'/goods/add',
        data
    })
}

// 获取商品列表
export const goodList = params =>{
    return request({
        method: 'get',
        url: '/goods/list',
        params: params,
    });
}

// 删除商品
export const gooDel = params =>{
    return request({
        method: 'get',
        url: '/goods/del',
        params: params,
    });
}

// 修改商品


export const gooedit=(data)=>{
    return request({
        method:'post',
        url:'/goods/edit',
        data
    })
}

// 添加分类



export const addcate=(data)=>{
    return request({
        method:'post',
        url:'/goods/addcate',
        data
    })
}

// 获取分类


export const catelist = params =>{
    return request({
        method: 'get',
        url: '/goods/catelist',
        params: params,
    });
}

// 修改分类



export const editcate=(data)=>{
    return request({
        method:'post',
        url:'/goods/editcate',
        data
    })
}

// 删除分类


export const delcate= params =>{
    return request({
        method: 'get',
        url: '/goods/delcate',
        params: params,
    });
}

